package com.example.mapper;

import com.example.entity.Orders;
import com.example.entity.OrdersItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface OrdersItemMapper {
    int insert(OrdersItem ordersItem);
    
    List<OrdersItem> selectAll(OrdersItem ordersItem);

    void updateById(OrdersItem ordersItem);

    void deleteById(Integer id);

    @Select("select * from `orders_item` where id = #{id}")
    OrdersItem selectById(Integer id);

    @Select("select * from `orders_item` where order_id = #{id}")
    List<OrdersItem> selectByOrderId(Integer id);
}
